package edu.whu.demo.dao;

import edu.whu.demo.domain.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zxj
 * @since 2023-10-18
 */
@Mapper
public interface SupplierDao extends BaseMapper<Supplier> {
    @Select("select supplier.* from supplier left join comm_supp on comm_supp.supp_id = supplier.id left join commodity on commodity.id = comm_supp.comm_id and commodity.id = #{productId}")
    public List<Supplier> selectByCommId(@Param("productId")int productId);
}
